package cn.com.surker.material.dao;

import cn.com.surker.material.entity.MainMaterialTransportCar;
import cn.com.surker.material.vo.MaterialTransportPriceVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 材料运输车辆表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-06-29
 */
public interface MainMaterialTransportCarDao extends BaseMapper<MainMaterialTransportCar> {

    /**
     * 查询车牌号是否存在
     * @param contractId
     * @param carNo
     * @return
     */
    Integer findExistCarNo(Long contractId, String carNo, String today, String startTime, Long supplierId);

    /**
     * 批量新增
     * @param carList
     * @return
     */
    Integer saveBatch(List<MainMaterialTransportCar> carList);

    /**
     * 查询某个合同下运输的车牌信息
     * @param dbCode
     * @param orgId
     * @param supplierId
     * @param startTime
     * @param endTime
     * @return
     */
    List<MainMaterialTransportCar> findTodayWeightCar(String dbCode, Long orgId, Long contractId, Long supplierId, String startTime, String endTime);

    /**
     * 根据车牌查询运输单价信息
     * @param dbCode
     * @param supplierId
     * @param materialId
     * @param type
     * @param carNo
     * @param outTime
     * @return
     */
    MaterialTransportPriceVo findTransportPrice(String dbCode, Long supplierId, Long materialId, Integer type,
                                                String carNo, String outTime);
}
